<?php ob_start();
include("config/config.php"); 
if(isset($_SESSION['business_url'])){ 
	$sql=mysql_query("INSERT INTO `my_business_page_url` SET `userid`=1 ,`cat_id`='".$_SESSION['cat_id']."',
															`url`='".$_SESSION['business_url']."' ")or die(mysql_error());
	$id=mysql_insert_id();
	if($sql){
		unset($_SESSION['business_url']);
		unset($_SESSION['cat_id']);
		$_SESSION['user_id']=1;
		$_SESSION['url_id']=$id;
	}
}

if(isset($_POST['submit_fanpage_x'])){ 
	$sql=mysql_query("UPDATE `my_business_page_url` SET `page_url`='".$_POST['page_url']."',`page_height`='".$_POST['height']."'
														WHERE `id`='".$_SESSION['url_id']."' ")or die(mysql_error());
	if($sql){
		$_SESSION['url']=1;
		header("location:".$_SERVER['HTTP_REFERER']); exit;
	}
}
//Submit Artical ///////////////////////////////////////////////////
if(isset($_POST['submit_artical'])){ 
	$sql=mysql_query("UPDATE `my_business_page_url` SET `article_title`='".addslashes($_POST['title'])."',
												   `article_discription`='".addslashes($_POST['artical'])."',
												   `fetured_image`=''
												 	WHERE `id`='".$_SESSION['url_id']."'  ")or die(mysql_error());
	if($sql){
		$_SESSION['url']=1;
		header("location:".$_SERVER['HTTP_REFERER']); exit;
	}
}
//Submit About//////////////////////////////////////////////
if(isset($_POST['Submit_about_x'])){ //print_r($_POST); die();
	$sql=mysql_query("UPDATE `my_business_page_url` SET `description`='".addslashes($_POST['description'])."',
												   `website`='".$_POST['website']."',
												   `email`='".$_POST['email']."',
												   `phone`='".$_POST['phone']."', `status` = 1
												 	WHERE `id`='".$_SESSION['url_id']."'  ")or die(mysql_error());
	if($sql){
		$_SESSION['url']=1;
		header("location:".$_SERVER['HTTP_REFERER']); exit;
	}
}
/////////////////////////////////////////////////////////////
if(isset($_SESSION['url_id'])){ $url=get_allitem('my_business_page_url','id',$_SESSION['url_id']); }
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="css/mains.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/html5.js"></script>
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="js/jquery.form.js" ></script>
<script type="text/javascript" src="js/tab.js"></script>
<script type="text/javascript" src="js/animation.js"></script> 


<script type="text/javascript" src="js/city.js"></script>
<script language="javascript">
$(document).ready(function() {
$.featureList(
$(".steps ul li a"),
$("#output2 li "), {
start_item	:	0
}
);

jQuery.validator.addMethod("default_value", function(value, element, param) {
  return this.optional(element) || value !== param;
}, "Please Enter a currect value!");

$("#fanpage").validate({
	rules: {
        page_url: {
              required: true,
			  default_value:"http://www.yoursitename.com/fanpage.html  (example)"
        },
        height: {
            required: true
        }
    }
});
$("#artical_form").validate({
	rules: {
        title: {
              required: true,
			  default_value:"Write your  Artical Titel Here!"
        },
        artical: {
            required: true
        }
    }
});
$("#about_form").validate({
	rules: {
        description: { required: true },
		email: { required: true },
		agree: { required: true },
        website: { required: true }
    }
});
});
function publish(obj){ 
	$.post("add_to_tamp.php",{status:obj},function(data){ 
		if(data==1){ alert("Your Url Suscessfully Activated");
		}else{alert("Your Url Suscessfully Deactivated");}
                
	});
}
</script>
<script type="text/javascript" >
 $(document).ready(function() { 
		
            $('#photoimg').live('change', function(){ 
			           $(".wait").html('');
			    $(".wait").html('<img src="images/loader.gif" alt="Uploading...."/>');
			$("#imageform").ajaxForm({
			   target: '.photo_gallery'
		}).submit();
		
			});
        })</script>
</head>

<body>
<!--Main div start-->
<div id="main">

<!--Header section start-->
<header id="header">
<!--Head main start-->
<div class="head_main">
<div class="logo"><a href=""><img src="images/logo.png" alt="" /></a></div>
<div class="header_rt">
<div class="welcome_main">
<div class="welcome_name">Welcome “John smith”   Date   20jan2012 </div>
<div class="head_date">16:00</div>
</div>
<ul class="myaccount">
<li><a href="#">My Account</a></li>
<li><a href="logout.php">Logout </a></li>         
</ul>
</div>
</div>
<!--Head main start-->
<!--Hider layer section start-->
<div class="hide_layer_main">
<div class="hide_layer_bt"><a href="#"><img src="images/hide_layer_bt.png" /></a></div>
<div class="hide_layear_head">
<h1><span>Create New Page</span>integer vehicula purus quis mi</h1>
</div>
<nav class="main_nav">
<ul>
<li>
<a href="#">
<span class="first">What New</span>
<div>molestie auctor laoreet</div>
</a>
</li>

<li>
<a href="#">
<span class="second">My Fan Page </span>
<div>molestie auctor laoreet</div>
</a>
</li>

<li>
<a href="#">
<span class="third">Faverates </span>
<div>molestie auctor laoreet</div>
</a>
</li>

<li>
<a href="#">
<span class="fourth">Post Artical </span>
<div>molestie auctor laoreet</div>
</a>
</li>

<li>
<a href="#">
<span class="fifth">Advitsments</span>
<div>molestie auctor laoreet</div>
</a>
</li>

</ul>
</nav>
</div>
<!--Hider layer section end-->


</header>
</div>
 
<div class="topfix"></div>
 <div class="container">
<div id="SquareGrid"  >
    
      
          
   
    <div class="element" >
     asdasdasd
    </div>

    <div class="element" >
     asdasdasd
    </div>
    
          <div class="element" >
     asdasdasd
    </div>

    <div class="element" >
     asdasdasd
    </div>

    <div class="element"   >
     asdasdasd
    </div>
          <div class="element" >
     asdasdasd
    </div>

    <div class="element"  >
     asdasdasd
    </div>

    <div class="element"   >
     asdasdasd
    </div>
</div>
 </div>
 




<script>
 $(function(){
  
      var $container = $('#SquareGrid'),
          // object that will keep track of options
          isotopeOptions = {},
          // defaults, used if not explicitly set in hash
          defaultOptions = {
            filter: '*',
            sortBy: 'original-order',
            sortAscending: true,
            layoutMode: 'masonry'
          };

      
      // add randomish size classes
      $container.find('.element').each(function(){
        var $this = $(this),
            number = parseInt( $this.find('.number').text(), 10 );
        if ( number % 7 % 2 === 1 ) {
          $this.addClass('width2');
        }
        if ( number % 3 === 0 ) {
          $this.addClass('height2');
        }
      });
  
      var setupOptions = $.extend( {}, defaultOptions, {
        itemSelector : '.element',
        masonry : {
          columnWidth : 10
        },
        cellsByRow : {
          columnWidth : 240,
          rowHeight : 240
        },
        getSortData : {
          symbol : function( $elem ) {
            return $elem.attr('data-symbol');
          },
          category : function( $elem ) {
            return $elem.attr('data-category');
          },
          number : function( $elem ) {
            return parseInt( $elem.find('.number').text(), 10 );
          },
          weight : function( $elem ) {
            return parseFloat( $elem.find('.weight').text().replace( /[\(\)]/g, '') );
          },
          name : function ( $elem ) {
            return $elem.find('.name').text();
          }
        }
      });
  
      // set up Isotope
      $container.isotope( setupOptions );
  
      var $optionSets = $('#options').find('.option-set'),
          isOptionLinkClicked = false;
  
      // switches selected class on buttons
      function changeSelectedLink( $elem ) {
        // remove selected class on previous item
        $elem.parents('.option-set').find('.selected').removeClass('selected');
        // set selected class on new item
        $elem.addClass('selected');
      }
  
  
      $optionSets.find('a').click(function(){
        var $this = $(this);
        // don't proceed if already selected
        if ( $this.hasClass('selected') ) {
          return;
        }
        changeSelectedLink( $this );
            // get href attr, remove leading #
        var href = $this.attr('href').replace( /^#/, '' ),
            // convert href into object
            // i.e. 'filter=.inner-transition' -> { filter: '.inner-transition' }
            option = $.deparam( href, true );
        // apply new option to previous
        $.extend( isotopeOptions, option );
        // set hash, triggers hashchange on window
        $.bbq.pushState( isotopeOptions );
        isOptionLinkClicked = true;
        return false;
      });

      var hashChanged = false;

      $(window).bind( 'hashchange', function( event ){
        // get options object from hash
        var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {},
            // do not animate first call
            aniEngine = hashChanged ? 'best-available' : 'none',
            // apply defaults where no option was specified
            options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } );
        // apply options from hash
        $container.isotope( options );
        // save options
        isotopeOptions = hashOptions;
    
        // if option link was not clicked
        // then we'll need to update selected links
        if ( !isOptionLinkClicked ) {
          // iterate over options
          var hrefObj, hrefValue, $selectedLink;
          for ( var key in options ) {
            hrefObj = {};
            hrefObj[ key ] = options[ key ];
            // convert object into parameter string
            // i.e. { filter: '.inner-transition' } -> 'filter=.inner-transition'
            hrefValue = $.param( hrefObj );
            // get matching link
            $selectedLink = $optionSets.find('a[href="#' + hrefValue + '"]');
            changeSelectedLink( $selectedLink );
          }
        }
    
        isOptionLinkClicked = false;
        hashChanged = true;
      })
        // trigger hashchange to capture any hash data on init
        .trigger('hashchange');

    });
	
	

</script>




 
<!--Main div end-->

<? include("footer.php");  ?>